<template>
	<view class="" style="padding: 0 20rpx;">
		<view class="flex justify-between align-center header-text" v-for="(item, index) in listFrom" :key="index">
			<view class="flex align-center">
				<view class="" style="margin-left: 20rpx;">
					<image style="width: 84rpx;height: 84rpx;border-radius: 42rpx;" :src="'http://three.qianjiwl.xyz'+item.avatar" mode=""></image>
				</view>
				<view class="" style="margin-left: 20rpx;">
					<view class="" style="font-size: 28rpx;">
						{{item.nickname}}
					</view>
					<view class="" style="margin-top: 5rpx;">
						{{item.mobile}}
					</view>
				</view>
			</view>
			<view class="bgc" @tap="addUSer(item.id)">
				转账
			</view>
		</view>

		<u-popup v-model="show" mode="center" border-radius="20">
			<view class="flex align-center" style="height: 200rpx;padding:  0 20rpx;">
				<u-input v-model="value" :type="type" placeholder="请输入转账金额" :border="border" /> <text class="add" @tap="add">确定</text>
			</view>
		</u-popup>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				value: '',
				type: 'number',
				border: true,
				listFrom: [],
				collect_user_id: '',
			}
		},
		onLoad() {
			this.getList()
		},
		methods: {
			getList () {
				this.$api('user.myTeamTwo',{
				}).then(res => {
					if(res.code == 1) {
						this.listFrom = res.data
					}
				})
			},
			
			add () {
				this.$api('user.huzhuan',{
					num: this.value,
					collect_user_id: this.collect_user_id
				}).then(res => {
					if(res.code == 1) {
						this.show = false
					} 
				}) 
				console.log(this.value)
			},
			
			addUSer(id) {
				this.show = true
				this.collect_user_id = id
			}
		}
	}
</script>

<style lang="less" scoped>
	.header-text {
		height: 128rpx;
		margin-top: 20rpx;
		font-size: 24rpx;
		border-radius: 10rpx;
		background-color: #FFFFFF;

		.bgc {
			margin-right: 10rpx;
			font-size: 24rpx;
			background-color: #CBAC7A;
			padding: 13rpx 50rpx;
			border-radius: 10rpx;
			color: #FFFFFF;
		}
	}
	
	.add {
		color: #FFFFFF;
		margin-left: 20rpx;
		margin-right: 20rpx;
		height: 60rpx;
		width: 100rpx;
		text-align: center;
		border-radius: 10rpx;
		line-height: 60rpx;
		font-size: 22rpx;
		display: inline-block;
		background-color: #CBAC7A;
	}
</style>
